home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 123 / CD Gamer Issue 123 (June 2003) (Disc 1).ISO / Games / Dev_Demo_EU / data1.cab / App_Executables / System / umake.bat < prev    next >
Encoding:
DOS Batch File  |  2003-02-28  |  24.0 KB  |  730 lines

  1. @echo off
  2. set DOEXIT=0
  3. :: UMAKE has been replaced by the UCC UMAKE commandlet.  This batch file
  4. :: only serves as a wrapper now to handle special cases.
  5. if "%1"=="auto" (SHIFT & SET DOEXIT=1)
  6. if "%1"=="release" goto MakeRelease
  7. if "%1"=="debug" goto MakeDebug
  8. if "%2"=="everything" goto MakeMSDEV
  9. if "%1"=="cpp" goto MakeCPP
  10. if "%1"=="realclean" goto CleanMSDEV
  11. ucc.exe umake %1 %2 %3 %4 %5 %6 %7 %8 %9
  12. goto end
  13.  
  14. :MakeMSDEV
  15. :: MSDEV ..\UD.DSW /MAKE "aBuildall - RELEASE"
  16. ::buildconsole ..\UD.DSW /all /prj="aBuildall" /browseinfo=OFF /cfg="Win32 Release"
  17. devenv /nologo /build Release ..\UD.SLN
  18. if "%1"=="cpp" goto end if %ERRORLEVEL%==0 goto ScriptMake goto end
  19. :ScriptMake
  20. ucc.exe umake all content
  21. goto end
  22.  
  23. :CleanMSDEV
  24. ucc.exe umake clean
  25. ::buildconsole ..\ud.dsw /clean /prj="aBuildall" /cfg="Win32 Debug"
  26. ::buildconsole ..\ud.dsw /clean /prj="aBuildall" /cfg="Win32 Release"
  27. ::MSDEV ..\UD.DSW /MAKE "aBuildall - DEBUG" /CLEAN
  28. ::MSDEV ..\UD.DSW /MAKE "aBuildall - RELEASE" /CLEAN
  29. devenv /clean Release ..\UD.SLN
  30. for %%V in (*.lib) do echo Cleaning %%V && del /F %%V
  31. pushd ..
  32. for /R %%V in (*.cod,*.plg,*.exp,*.ilk) do echo Cleaning %%V && del /F %%V
  33. for /R /D %%V in (Debug.*,Release.*,dLib.*) do echo Cleaning %%V && RD /S /Q %%V
  34. popd
  35. goto end
  36.  
  37. :MakeRelease
  38. if exist ogg.dll del ogg.dll
  39. devenv /nologo /build Release ..\UD.SLN
  40. goto end
  41.  
  42. :MakeDebug
  43. if exist ogg.dll del ogg.dll
  44. devenv /nologo /build Debug ..\UD.SLN
  45. goto end
  46.  
  47. :MakeCPP
  48. devenv /nologo /build Release /project %2 ..\UD.SLN
  49. goto end
  50.  
  51. :: ============================================================================
  52.  
  53. ::                               OLD CODE
  54.             
  55. :: ============================================================================
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. :: ============================================================================
  82.  
  83. :: ----------------------------------------------------------------------------
  84. :: Program: UMAKE Batch File
  85. :: Author: Bob Berry
  86. :: Contributor: Ray Davis
  87. :: Revision: 1.1.1
  88. :: ----------------------------------------------------------------------------
  89.  
  90. :: ============================================================================
  91. :: NOTE: 'unreal.ini' refers to whatever configuration file you are using for
  92. :: your engine developments.  This could be "unrealtournament.ini" or
  93. :: "mycustomgame.ini" or whatever.
  94. :: ============================================================================
  95.  
  96. :: ----------------------------------------------------------------------------
  97. :: REQUIREMENTS:
  98. :: ----------------------------------------------------------------------------
  99. ::
  100. :: In your Unreal\System directory, you should have a file called "mini.ini"
  101. :: that is a trimmed down version your unreal.ini.  The [Editor.EditorEngine]
  102. :: section should have only the "EditPackages" you need to rebuild this
  103. :: particular package. i.e. C:\Unreal\System\mini.ini.  When you perform a
  104. :: "UMAKE Create MyProject" (see below), a copy of the mini.ini file is made
  105. :: to your new package directory and renamed to make.ini.  If you wish to
  106. :: manually create this file, be sure to place it in the appropriate
  107. :: directory (e.g. "C:\Unreal\MyPackage\make.ini").
  108. ::
  109. :: It is not necessary to copy the *entire* unreal.ini file.  It is
  110. :: possible to only include the following sections:
  111. ::
  112. ::    [Engine.Engine]
  113. ::    EditorEngine=Editor.EditorEngine
  114. ::
  115. ::    [Core.System]
  116. ::    Paths=../System/*.u
  117. ::        <paths to other content>
  118. ::
  119. ::    [Editor.EditorEngine]
  120. ::    EditPackages=Core
  121. ::        <other edit packages>
  122. ::
  123. :: NOTE: Do NOT put this file in your "classes" directory.
  124. ::
  125. :: ----------------------------------------------------------------------------
  126. ::
  127. :: In your Unreal\System directory, create another file called "makeall.ini"
  128. :: that is a copy of your unreal.ini (or mini.ini).  The [Editor.EditorEngine]
  129. :: section should have the "EditPackages" you need to rebuild ALL of *your
  130. :: custom packages*.
  131. ::
  132. :: ----------------------------------------------------------------------------
  133. ::
  134. :: In your Unreal\System directory, create another file called "makefull.ini"
  135. :: that is a copy of your unreal.ini (or mini.ini).  The [Editor.EditorEngine]
  136. :: section should have the "EditPackages" you need to rebuild *ALL* unreal
  137. :: packages.
  138. ::
  139. :: ----------------------------------------------------------------------------
  140. ::
  141. :: In your Unreal\System directory, create another file called "mini.ini"
  142. :: that is a copy of your unreal.ini (or mini.ini).  The [Editor.EditorEngine]
  143. :: section should have the "EditPackages" you need to rebuild *ALL* unreal
  144. :: packages.
  145. ::
  146. :: ----------------------------------------------------------------------------
  147. ::
  148. :: Edit the CONFIG SECTION below to reflect your development environment.
  149. ::
  150. :: ----------------------------------------------------------------------------
  151.  
  152. :: ============================================================================
  153.  
  154. :: ----------------------------------------------------------------------------
  155. ::
  156. :: USAGE: umake.bat <mode> [ucc options]
  157. ::
  158. :: <mode> = create|package|all|full|export|import
  159. :: [ucc options] = options pased directly to ucc.exe (-nobind, -yes, etc)
  160. ::
  161. :: ----------------------------------------------------------------------------
  162. ::
  163. :: Option 1: "umake.bat Create <package>"
  164. ::
  165. :: The Create command will setup a new project.  It will first create a new
  166. :: subdirectory residing under your Unreal directory with the name given in
  167. :: <package>.  It will also create the Classes/Models/Textures/Src/Inc
  168. :: directories as well.  A copy of your %MINIINI% (see above) will be placed
  169. :: in the new directory and the new EditPackage will be *appended* to it (so
  170. :: be sure that the EditPackages declarations are the last lines of the file.
  171. ::
  172. ::----------------------------------------------------------------------------
  173. ::
  174. :: Option 2: "umake.bat MyPackage"
  175. ::
  176. :: First will backup the existing "MyPackage.U" file (if it exists) to your
  177. :: package's root directory. (i.e. C:\UT\MyPackage). It will then rebuild all
  178. :: "EditPackages" found in the make.ini file located in the package's root
  179. :: directory.
  180. ::
  181. :: ----------------------------------------------------------------------------
  182. ::
  183. :: Option 3: "umake.bat all [content|everything] [ucc options]"
  184. ::
  185. :: First will backup all packages listed in the ALLPACKAGES variable below
  186. :: (see config section) to your BACKUP directory. It will then rebuild all
  187. :: "EditPackages" found in your makeall.ini file.
  188. ::
  189. :: If 'everything' specified, compiles C++ code first and also compiles content
  190. :: If 'content' is specified, will compile content before script code
  191. ::
  192. :: ----------------------------------------------------------------------------
  193. ::
  194. :: Option 4: "umake.bat full -nobind"
  195. ::
  196. :: First will backup ALL .U packages (including core.u, engine.u, etc) to
  197. :: your BACKUP directory. It will then rebuild all "EditPackages" found
  198. :: in your makefull.ini file. In this example, the "-nobind" parameter will
  199. :: be passed to the compiler.
  200. ::
  201. :: ----------------------------------------------------------------------------
  202. ::
  203. :: Option 5: "umake.bat export <texture|sound> [PkgName]"
  204. ::
  205. :: The following information applies to both textures and sounds where SRCDIR
  206. :: is actually "TEXTURESRC" or "SOUNDSRC", and similarly BINDIR is actually
  207. :: referring to "TEXTUREBIN" or "SOUNDBIN".
  208. ::
  209. :: If PkgName is specified, it will export a single package from BINDIR of the
  210. :: given name to the SRCDIR.
  211. ::
  212. :: If PkgName is omitted, this will examine the SRCDIR directory to first
  213. :: compile a list of package names.  Then for each name it will attempt to
  214. :: locate a package in the BINDIR directory and export it to SRCDIR.
  215. ::
  216. :: Ex: "umake.bat export texture MyTextures"
  217. :: (where MyTextures.utx is in SRCBIN)
  218. ::
  219. :: ----------------------------------------------------------------------------
  220. ::
  221. :: Option 6: "umake.bat import <texture|sound> [PkgName]"
  222. ::
  223. :: The following information applies to both textures and sounds where SRCDIR
  224. :: is actually "TEXTURESRC" or "SOUNDSRC", and similarly BINDIR is actually
  225. :: referring to "TEXTUREBIN" or "SOUNDBIN".
  226. ::
  227. :: If PkgName is specified, it will import a single package from SRCDIR of the
  228. :: given name to the BINDIR.  This means there should be a directory name in
  229. :: SRCDIR that corresponds to the package attempting to be created.
  230. ::
  231. :: If PkgName is omitted, this will examine the SRCDIR directory to first
  232. :: compile a list of package names.  Then for each name it will import all
  233. :: content from the SRCDIR and create a package with a corresponding name in
  234. :: the BINDIR.
  235. ::
  236. :: Ex: "umake.bat import texture MyTextures"
  237. :: (where MyTextures is a directory in SRCBIN)
  238. ::
  239. :: ----------------------------------------------------------------------------
  240. ::
  241. :: Option 7: "umake.bat [clean|realclean]"
  242. ::
  243. :: For each package listed in makeall.ini, delete the existing .U file if there
  244. :: also exists a directory with the package name along with a /Classes
  245. :: directory underneath it. (To prevent deletion of .U packages that have no
  246. :: script, like our mesh packages)
  247. ::
  248. :: "realclean" will delete all of the C++ intermediate stuff that VC++ misses
  249. :: on a project clean.  It will then proceed with the standard script cleaning.
  250. ::
  251. :: ----------------------------------------------------------------------------
  252.  
  253.  
  254.  
  255. :: ============================================================================
  256. :: ----------====+++***[[[/\/\]]] CONFIG SECTION [[[/\/\]]]***+++====----------
  257. :: ============================================================================
  258.  
  259. :: The root Unreal development directory (not system)
  260. set ROOT=..\
  261.  
  262. :: The name of the .ini file your compiler uses to look for EditPackages
  263. set UCCINI=UD.ini
  264.  
  265. :: The location of your mini.ini file
  266. set MINIINI=.\Mini.ini
  267.  
  268. :: The location of your content.ini file
  269. set CONTMAKE=.\Content.ini
  270.  
  271. :: List all your custom packages here separated by spaces.  Packages listed
  272. :: here will be backed up when a "umake all" is issued.
  273. :: set ALLPACKAGES=Core.U Engine.U UWindow.U Editor.U Fire.U IpDrv.U IpServer.U UWeb.U DigiView.U UnrealShare.U UnrealI.U Botpack.U ParticleSystems.U SpecialEffects.U DGibMeshes.U DWMeshes.U DCore.U DMessages.U DDebug.U DDecEffectMeshes.U DDecorations.U DDecorations2.U UTATrees2.U DMapComps.U DSkeleton.U DEffects.U DGamePlay.U DChars.U DInterface.U DHUDWindows.U DParticleEditor.U DVoice.U DHacker.U DInventory.U DTerritories.U DBrain.U DVoice.U DIdentities.U DOrderInterface.u DIntroChars.U
  274.  
  275. :: The executable and parameters.  Just the filename, no path.
  276. rem set MAKECOMMAND=UCC.EXE make -debug %2 %3 %4 %5
  277. set MAKECOMMAND=UCC.EXE make -warnresolve %2 %3 %4 %5
  278.  
  279. :: If set to YES, backups of packages will be made before deleting the old
  280. :: ones.  Backups for single project compiles are stored in the project
  281. :: directory.  Backups for "umake all" are stored in the BACKUPDIR specified
  282. :: below. Options are YES or NO (all caps, no quotes).
  283. :: NOTE: This can be time consuming if you are working with very large
  284. :: packages.
  285. set DOBACKUPS=YES
  286.  
  287. :: When doing a "umake.bat all", copies of the .u files you are about to
  288. :: rebuild will be placed in this directory.
  289. set BACKUPDIR=.\BACKUP
  290.  
  291. :: Directories containing content source.
  292. set TEXTURESRC=..\TextureSrc
  293. set SOUNDSRC=..\SoundSrc
  294.  
  295. :: Directory containing content binaries.
  296. set TEXTUREBIN=..\Textures
  297. set SOUNDBIN=..\Sounds
  298.  
  299. :: When you are finished configuring, set this variable to "YES".  Options are
  300. :: YES or NO (all caps, no quotes).
  301. set CONFIGURED=YES
  302.  
  303. :: Remote debugging semaphore file name.  If exists, files built are copied to
  304. :: the location specified in RDSystem
  305. set RDSEMAPHORE=RemoteDebug.ini
  306.  
  307. :: Remote base directory (not system).  Set if remote debugging
  308. set RDBASE=%REMOTEDEBUG%
  309. :: ============================================================================
  310. :: ============================================================================
  311. :: ============================================================================
  312. :: ------------- YOU SHOULDN'T NEED TO TOUCH ANYTHING BELOW  ------------------
  313. :: ----------------------------------------------------------------------------
  314. :: ---------------       If you do... be careful  :)         ------------------
  315. :: ============================================================================
  316. :: ============================================================================
  317. :: ============================================================================
  318.  
  319. if "%CONFIGURED%"=="NO" goto noconfig
  320.  
  321. :: Ensure we have a .ini file to start with
  322. if not exist %UCCINI% copy /y %ROOT%\System\default.ini %ROOT%\System\%UCCINI%
  323.  
  324. :: old version fix, was creating a file named backup, remvoe it
  325. if exist %BACKUPDIR% if not exist %BACKUPDIR%\nul del /F %BACKUPDIR%
  326.  
  327. :: Ensure we have a valid backup dir
  328. if not exist %BACKUPDIR% mkdir %BACKUPDIR%
  329.  
  330. set PACKAGE=%1
  331. set SYSTEM=%ROOT%\System
  332. set ORIGINI=%SYSTEM%\%UCCINI%
  333. set BACKINI=%SYSTEM%\orig.ini
  334. set SAFETYINI=%SYSTEM%\%UCCINI%.bak
  335. set MAKEPROG=%SYSTEM%\%MAKECOMMAND%
  336.  
  337. set RDSYSTEM=%RDBASE%\SYSTEM
  338. set RDTEXTURES=%RDBASE%\Textures
  339. set RDSOUNDS=%RDBASE%\Sounds
  340.  
  341. set ReturnTag=
  342.  
  343. if "%1"=="" goto usage
  344. if "%1"=="all" goto all
  345. if "%1"=="full" goto full
  346. if "%1"=="create" goto create
  347. if "%1"=="export" goto export
  348. if "%1"=="import" goto import
  349. if "%1"=="content" goto content
  350. if "%1"=="clean" goto clean
  351. if "%1"=="realclean" goto realclean
  352. goto pbuild
  353.  
  354. :: ----------------------------------------------------------------------------
  355. :: ------------------------ CREATE NEW PACKAGE---------------------------------
  356. :: ----------------------------------------------------------------------------
  357.  
  358. :create
  359. if "%2"=="" goto crtusage
  360. if not exist %MINIINI% goto miniini
  361. set NEWPKG=%2%
  362. set PRJPATH=%ROOT%\%NEWPKG%
  363. xcopy /q /s /t /I . %PRJPATH%\Classes
  364. xcopy /q /s /t /I . %PRJPATH%\Models
  365. xcopy /q /s /t /I . %PRJPATH%\Textures
  366. xcopy /q /s /t /I . %PRJPATH%\Source
  367. xcopy /q /s /t /I . %PRJPATH%\Include
  368. xcopy /q /s /t /I . %PRJPATH%\Resource
  369. copy %MINIINI% %PRJPATH%\make.ini
  370. echo EditPackages=%NEWPKG%>>%PRJPATH%\make.ini
  371. @echo.
  372. echo Package structure for %NEWPKG% created.
  373. @echo.
  374. goto end
  375.  
  376. :: ----------------------------------------------------------------------------
  377. :: ------------------------ REBUILD SPECIFIC PACKAGE---------------------------
  378. :: ----------------------------------------------------------------------------
  379.  
  380. :pbuild
  381. set UFILE=%PACKAGE%.U
  382. set PRJPATH=%ROOT%\%PACKAGE%
  383. set MAKEINI=%PRJPATH%\make.ini
  384. goto inicheck
  385.  
  386.  
  387. :: ----------------------------------------------------------------------------
  388. :: ------------------------ REBUILD ALL CUSTOM PACKAGES------------------------
  389. :: ----------------------------------------------------------------------------
  390.  
  391. :all
  392. if "%2"=="everything" goto MakeMSDEV
  393. if "%2"=="content" goto MakeALLCnt
  394. goto skip
  395. :contmake
  396. move /y %BACKINI% %ORIGINI%
  397. :skip
  398. set MAKEINI=%SYSTEM%\makeall.ini
  399. goto inicheck
  400.  
  401. :MakeMSDEV
  402. MSDEV ..\UD.DSW /MAKE "aBuildall - RELEASE"
  403. if %ERRORLEVEL%==0 goto MakeAllCnt
  404. goto end
  405.  
  406. :: ----------------------------------------------------------------------------
  407. :: ---------------------- REBUILD ALL UNREAL PACKAGES--------------------------
  408. :: ----------------------------------------------------------------------------
  409.  
  410. :full
  411. set MAKEINI=%SYSTEM%\makefull.ini
  412. goto inicheck
  413.  
  414. :: ----------------------------------------------------------------------------
  415. :: ------------------------- CHECK FOR INI FILES ------------------------------
  416. :: ----------------------------------------------------------------------------
  417.  
  418. :inicheck
  419. if not exist %MAKEINI% goto makeini
  420. if not exist %ORIGINI% goto origini
  421.  
  422. :: Go straight to "make" if we're not doing backups.
  423. if NOT "%DOBACKUPS%"=="YES" goto rmpacks
  424. if "%PACKAGE%"=="all" goto allback
  425. if "%PACKAGE%"=="full" goto fullback
  426. goto backup
  427.  
  428. :: ----------------------------------------------------------------------------
  429. :: -------------------- BACKUP OF PACKAGES TO BE BUILT ------------------------
  430. :: ----------------------------------------------------------------------------
  431.  
  432. :fullback
  433. copy /y %SYSTEM%\*.U %SYSTEM%\BACKUP
  434. goto rmfullpkg
  435.  
  436. :allback
  437. for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  438.    if exist %SYSTEM%\%%V.U (
  439.       copy /y %SYSTEM%\%%V.U %BACKUPDIR%
  440.    )
  441. )
  442. goto rmallpkg
  443.  
  444. :backup
  445. if exist %SYSTEM%\%UFILE% copy /y %SYSTEM%\%UFILE% %PRJPATH%
  446. goto rmpkg
  447.  
  448. :: ----------------------------------------------------------------------------
  449. :: ----------------- REMOVE PACkAGES TO BE REBUILT ----------------------------
  450. :: ----------------------------------------------------------------------------
  451.  
  452. :rmpacks
  453. if "%PACKAGE%"=="all" goto rmallpkg
  454. if "%PACKAGE%"=="full" goto rmfullpkg
  455. goto rmpkg
  456.  
  457. :rmfullpkg
  458. for %%V IN (%SYSTEM%\*.U) DO del %%V
  459. goto make
  460.  
  461. :rmallpkg
  462. for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  463.    if exist %SYSTEM%\%%V.U (
  464.        if exist %ROOT%\%%V\Classes (
  465.          echo Cleaning %%V && del /F %SYSTEM%\%%V.U
  466.       )
  467.    )
  468. )
  469. goto make
  470.  
  471. :rmpkg
  472. if exist %SYSTEM%\%UFILE% del %SYSTEM%\%UFILE%
  473. goto make
  474.  
  475. :: ----------------------------------------------------------------------------
  476. :: ---------------------------   EXPORT   -------------------------------------
  477. :: ----------------------------------------------------------------------------
  478.  
  479. :export
  480. if "%2"=="texture" goto ExpTex
  481. if "%2"=="sound" goto ExpSnd
  482. goto MissCntType
  483.  
  484. :ExpTex
  485. set SRCDIR=%TEXTURESRC%
  486. set BINDIR=%TEXTUREBIN%
  487. set EXT=UTX
  488. set EXP=texture
  489. goto ExpContent
  490.  
  491. :ExpSnd
  492. set SRCDIR=%SOUNDSRC%
  493. set BINDIR=%SOUNDBIN%
  494. set EXT=UAX
  495. set EXP=sound
  496. goto ExpContent
  497.  
  498. :ExpContent
  499. if "%3"=="" goto ExpCntALL
  500. if NOT exist %BINDIR%\%3.%EXT% echo. && echo %BINDIR%\%3 does not exist && goto MissCntType
  501. ucc pkg export %EXP% %BINDIR%\%3 %SRCDIR%\%3 -QUIET
  502. goto end
  503.  
  504. :ExpCntALL
  505. echo Exporting ALL %EXP% texture packages...
  506. for /D %%V in (%SRCDIR%\*.*) do (
  507.    if exist %BINDIR%\%%~nV.%EXT% (
  508.       ucc pkg export %EXP% %BINDIR%\%%~nV %SRCDIR%\%%~nV -QUIET
  509.    )
  510. )
  511. goto end
  512.  
  513. :: ----------------------------------------------------------------------------
  514. :: ---------------------------   IMPORT   -------------------------------------
  515. :: ----------------------------------------------------------------------------
  516.  
  517. :import
  518. move /y %ORIGINI% %BACKINI%
  519. copy %CONTMAKE% %ORIGINI%
  520. if "%2"=="texture" goto ImpTex
  521. if "%2"=="sound" goto ImpSnd
  522. goto MissCntType
  523.  
  524. :: -- umake all entry
  525. :: -- has to reset make command to not send "content" to ucc
  526. :: -- must first run a ucc make to make sure initial packages are built
  527. :MakeAllCnt
  528. set MAKECOMMAND=UCC.EXE make %3 %4 %5 %6
  529. set MAKINGALL=1
  530. :: added by JbP to delete packages (sorry :P)
  531. for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  532.    if exist %SYSTEM%\%%V.U if exist %SYSTEM%\..\%%V\nul del %SYSTEM%\%%V.U
  533. )
  534. move /y %ORIGINI% %BACKINI%
  535. copy %CONTMAKE% %ORIGINI%
  536. %MAKECOMMAND%
  537. goto ImpTex
  538.  
  539. :ImpTex
  540. set SRCDIR=%TEXTURESRC%
  541. set BINDIR=%TEXTUREBIN%
  542. set RDBIN=%RDTEXTURES%
  543. set EXT=UTX
  544. set IMP=texture
  545. goto ImpContent
  546.  
  547. :ImpSndMake
  548. set CONTMAKE=1
  549. goto ImpSnd
  550.  
  551. :ImpSnd
  552. set SRCDIR=%SOUNDSRC%
  553. set BINDIR=%SOUNDBIN%
  554. set RDBIN=%RDSOUNDS%
  555. set MAKINGALL=0
  556. set EXT=UAX
  557. set IMP=sound
  558. goto ImpContent
  559.  
  560. :ImpContent
  561. if "%3"=="" goto ImpCntALL
  562. if NOT exist %SRCDIR%\%3\nul (
  563.    echo. && echo %SRCDIR%\%3\nul does not exist && goto MissCntType
  564. )
  565. ucc pkg import %IMP% %3 %SRCDIR%\%3 -QUIET && move /y %3.%EXT% %BINDIR%
  566. if "%MAKINGALL%"=="1" goto ImpSndMake
  567. if "%CONTMAKE%"=="1" goto contmake
  568. move /y %BACKINI% %ORIGINI%
  569. goto RDCheck
  570. goto end
  571.  
  572. :ImpCntALL
  573. echo Building ALL %IMP% packages...
  574. for /D %%V in (%SRCDIR%\*.*) do (
  575.    ucc pkg import %IMP% %%~nV %SRCDIR%\%%~nV -QUIET && move /y %%~nV.%EXT% %BINDIR%
  576. )
  577. if "%MAKINGALL%"=="1" goto ImpSndMake
  578. if "%CONTMAKE%"=="1" goto contmake
  579. move /y %BACKINI% %ORIGINI%
  580. goto RDCheck
  581. goto end
  582.  
  583. :: ----------------------------------------------------------------------------
  584. :: ---------------------------  COMPILE  --------------------------------------
  585. :: ----------------------------------------------------------------------------
  586.  
  587. :make
  588. move /y %ORIGINI% %BACKINI%
  589. copy %BACKINI% %SAFETYINI%
  590. copy %MAKEINI% %ORIGINI%
  591. echo Compiling...
  592. %MAKEPROG%
  593. move /y %BACKINI% %ORIGINI%
  594. goto RDCheck
  595. goto end
  596.  
  597. :: ----------------------------------------------------------------------------
  598. :: -------------------------- REMOTE DEBUG CHECK ------------------------------
  599. :: ----------------------------------------------------------------------------
  600.  
  601. :RDCheck
  602. if exist %SYSTEM%\%RDSEMAPHORE% goto remotedebug
  603. goto end
  604.  
  605. :remotedebug
  606. if "%1"=="all" goto RDCopyAll
  607. if "%1"=="import" goto RDImpCheck
  608. goto RDCopySingle
  609.  
  610. :RDImpCheck
  611. if "%3"=="" goto RDImpCopyAll
  612. goto RDImpCopySingle
  613.  
  614. :RDImpCopyAll
  615. for %%V in (%BINDIR%\*.%EXT%) do copy /y %%V %RDBIN%
  616. goto end
  617.  
  618. :RDImpCopySingle
  619. if exist %BINDIR%\%3.%EXT% copy /y %BINDIR%\%3.%EXT% %RDBIN%
  620. goto end
  621.  
  622. :RDCopyAll
  623. for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  624.    if exist %SYSTEM%\%%V.U copy /y %SYSTEM%\%%V.U %RDSYSTEM%
  625. )
  626. goto end
  627.  
  628. :RDCopySingle
  629. if exist %SYSTEM%\%UFILE% copy /y %SYSTEM%\%UFILE% %RDSYSTEM%
  630. goto end
  631.  
  632. :: ----------------------------------------------------------------------------
  633. :: ---------------------------  REALCLEAN  ------------------------------------
  634. :: ----------------------------------------------------------------------------
  635. :realclean
  636. for %%V in (*.lib) do echo Cleaning %%V && del /F %%V
  637.  
  638. if exist %BACKUPDIR% pushd %BACKUPDIR%
  639. for %%V in (*.U) do echo Cleaning %%V && del /F %%V
  640. popd
  641. if exist %BACKUPDIR% rd %BACKUPDIR%
  642.  
  643. pushd ..
  644. for /R %%V in (*.cod,*.plg,*.exp,*.ilk) do echo Cleaning %%V && del /F %%V
  645. for /R /D %%V in (Debug.*,Release.*,dLib.*) do echo Cleaning %%V && RD /S /Q %%V
  646. popd
  647.  
  648. :: (falls down into clean)
  649.  
  650. :: ----------------------------------------------------------------------------
  651. :: ---------------------------  CLEAN  ----------------------------------------
  652. :: ----------------------------------------------------------------------------
  653.  
  654. :clean
  655. if "%DOBACKUPS%"=="YES" if "%1" NEQ "realclean" (
  656.    for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  657.       if exist %SYSTEM%\%%V.U (
  658.          copy /y %SYSTEM%\%%V.U %SYSTEM%\%BACKUPDIR%
  659.       )
  660.    )
  661. )
  662. for /F "tokens=2* usebackq delims==" %%V in (`grep -i Editpackages= makeall.ini`) DO (
  663.    if exist %SYSTEM%\%%V.U (
  664.        if exist %ROOT%\%%V\Classes (
  665.          echo Cleaning %%V && del /F %SYSTEM%\%%V.U
  666.       )
  667.    )
  668. )
  669. goto end
  670.  
  671. :: ----------------------------------------------------------------------------
  672. :: ---------------------------  ERRORS  ---------------------------------------
  673. :: ----------------------------------------------------------------------------
  674.  
  675. :noconfig
  676. @echo.
  677. echo You MUST configure this program before using.  Edit this batch file in
  678. echo your favorite text editor and read the instructions thoroughly.
  679. echo Failure to do so could result in damage to your Unreal environment.
  680. @echo.
  681. goto end
  682.  
  683. :usage
  684. @echo.
  685. echo "Usage: %0 <create|packagename|all|full> [ucc options]"
  686. @echo.
  687. goto end
  688.  
  689. :MissCntType
  690. @echo.
  691. echo "Usage: %0 <import|export> <sound|texture> [PkgName]"
  692. @echo.
  693. goto end
  694.  
  695. :crtusage
  696. @echo.
  697. echo "Usage: %0 create <packagename> [dependency1] [dependency2] [...]"
  698. @echo.
  699. goto end
  700.  
  701. :CntUsage
  702. @echo.
  703. echo "Usage: %0 content <textures|sounds|all>"
  704. @echo.
  705. goto end
  706.  
  707. :makeini
  708. @echo.
  709. echo Can't locate %MAKEINI%.  Please check your configuration by editing the
  710. echo cofig section of this batch file.
  711. @echo.
  712. goto end
  713.  
  714. :origini
  715. @echo.
  716. echo Can't locate %ORIGINI%.  Please check your configuration by editing the
  717. echo config section of this batch file.
  718. @echo.
  719. goto end
  720.  
  721. :miniini
  722. @echo.
  723. echo Can't locate %MINIINI%.  Please check your configuration by editing the
  724. echo cofig section of this batch file.
  725. @echo.
  726. goto end
  727.  
  728. :end
  729. if %DOEXIT%==1 exit %ERRORLEVEL%
  730.